package com.tal.order.service.feignclient;

import com.tal.order.dto.Stock;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author max
 * @version 1.0.0
 * @ClassName WarehouseServiceFeignClient.java
 * @Description TODO
 * @createTime 2021年03月27日 23:00:00
 */

@FeignClient(name = "warehouse-service", url = "http://${external.service.address}/")
public interface WarehouseServiceFeignClient {
    @GetMapping("/stock")
    Stock getStock(@RequestParam("skuId") Long skuId);

    @RequestMapping(method = RequestMethod.POST, value = "/stock/{skuId}", consumes = "text/plain")
    String updateStock(@PathVariable("skuId") Long skuId);

    @RequestMapping(method = RequestMethod.POST, value = "/stockDetails", consumes = "application/json")
    Stock update(Stock stock);
}
